$(function () {
	"use strict";

	var bodyBgClass = 'jane-body-background-class';

	let name = localStorage.getItem(bodyBgClass);
	if(name){
        setLocalBg(name);
    }else{
        setLocalBg('bg-theme bg-theme3');
    }

  /*switcher*/
	$(".switcher-btn").on("click", function () {
        $(".switcher-wrapper").toggleClass("switcher-toggled");
	});

  $('#theme1').click(theme1)
  $('#theme2').click(theme2)
  $('#theme3').click(theme3)
  $('#theme4').click(theme4)
  $('#theme5').click(theme5)
  $('#theme6').click(theme6)

  $('#theme7').click(theme7)
  $('#theme8').click(theme8)
  $('#theme9').click(theme9)
  $('#theme10').click(theme10)
  $('#theme11').click(theme11)
  $('#theme12').click(theme12)

  $('#theme13').click(theme13)
  $('#theme14').click(theme14)
  $('#theme15').click(theme15)

  function setLocalBg(classValue) {
    localStorage.setItem(bodyBgClass, classValue)
    $('body').attr('class', classValue);
  }

  function setBodyClass(classValue) {
    setLocalBg(classValue);
    $(".switcher-wrapper").toggleClass("switcher-toggled");
  }

  function theme1() {
    setBodyClass('bg-theme bg-theme1');
  }

  function theme2() {
    setBodyClass('bg-theme bg-theme2')
  }

  function theme3() {
    setBodyClass('bg-theme bg-theme3')
  }

  function theme4() {
    setBodyClass('bg-theme bg-theme4')
  }

  function theme5() {
    setBodyClass('bg-theme bg-theme5')
  }

  function theme6() {
    setBodyClass('bg-theme bg-theme6')
  }

  function theme7() {
    setBodyClass('bg-theme bg-theme7')
  }

  function theme8() {
    setBodyClass('bg-theme bg-theme8')
  }

  function theme9() {
    setBodyClass('bg-theme bg-theme9')
  }

  function theme10() {
    setBodyClass('bg-theme bg-theme10')
  }

  function theme11() {
    setBodyClass('bg-theme bg-theme11')
  }

  function theme12() {
    setBodyClass('bg-theme bg-theme12')
  }
  function theme13() {
    setBodyClass('bg-theme bg-theme13')
  }

  function theme14() {
      setBodyClass('bg-theme bg-theme14')
  }
  function theme15() {
      setBodyClass('bg-theme bg-theme15')
  }
});

/* perfect scrol bar */
// new PerfectScrollbar('.header-message-list');
// new PerfectScrollbar('.header-notifications-list');
